package com.ostrich.module_community

import androidx.lifecycle.LiveData
import com.ostrich.library_base.BaseRepository
import com.ostrich.library_net.BaseResponse
import com.ostrich.library_net.RetrofitManager
import com.ostrich.module_community.attention.entity.AttentionEntity
import com.ostrich.module_community.recommend.entity.ReCommendEntity

/**
 * @Author : yaotianxue
 * @Time : On 2023/10/31 15:14
 * @Description : CommunityRepositiory
 */
class CommunityRepository:BaseRepository() {
    //惰性：使用时候才会初始化
    private val communityApi:CommunityApi by lazy{
        RetrofitManager.instance.createService(CommunityApi::class.java)
    }
    //关注
    fun attention(): LiveData<BaseResponse<MutableList<AttentionEntity>>>{
        return communityApi.attention()
    }

    fun recommend():LiveData<BaseResponse<MutableList<ReCommendEntity>>>{
        return communityApi.recommend()
    }



}